/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.hwccl.importor.users.model.impl;

import com.hwccl.importor.users.model.Users;
import com.hwccl.importor.users.model.UsersModel;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

/**
 * The base model implementation for the Users service. Represents a row in the &quot;Import_Users&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.hwccl.importor.users.model.UsersModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UsersImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a users model instance should use the {@link com.hwccl.importor.users.model.Users} interface instead.
 * </p>
 *
 * @author Meanson Wang
 * @see UsersImpl
 * @see com.hwccl.importor.users.model.Users
 * @see com.hwccl.importor.users.model.UsersModel
 * @generated
 */
public class UsersModelImpl extends BaseModelImpl<Users> implements UsersModel {
	public static final String TABLE_NAME = "Import_Users";
	public static final Object[][] TABLE_COLUMNS = {
			{ "id_", new Integer(Types.BIGINT) },
			{ "companyId", new Integer(Types.BIGINT) },
			{ "screenName", new Integer(Types.VARCHAR) },
			{ "firstName", new Integer(Types.VARCHAR) },
			{ "lastName", new Integer(Types.VARCHAR) },
			{ "male", new Integer(Types.INTEGER) },
			{ "email", new Integer(Types.VARCHAR) },
			{ "jobtitle", new Integer(Types.VARCHAR) },
			{ "organization", new Integer(Types.VARCHAR) },
			{ "department", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table Import_Users (id_ LONG not null primary key,companyId LONG,screenName VARCHAR(75) null,firstName VARCHAR(75) null,lastName VARCHAR(75) null,male INTEGER,email VARCHAR(75) null,jobtitle VARCHAR(75) null,organization VARCHAR(75) null,department VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table Import_Users";
	public static final String ORDER_BY_JPQL = " ORDER BY users.screenName ASC";
	public static final String ORDER_BY_SQL = " ORDER BY Import_Users.screenName ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.hwccl.importor.users.model.Users"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.hwccl.importor.users.model.Users"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.hwccl.importor.users.model.Users"));

	public UsersModelImpl() {
	}

	public long getPrimaryKey() {
		return _id;
	}

	public void setPrimaryKey(long pk) {
		setId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_id);
	}

	public long getId() {
		return _id;
	}

	public void setId(long id) {
		_id = id;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public String getScreenName() {
		if (_screenName == null) {
			return StringPool.BLANK;
		}
		else {
			return _screenName;
		}
	}

	public void setScreenName(String screenName) {
		_screenName = screenName;
	}

	public String getFirstName() {
		if (_firstName == null) {
			return StringPool.BLANK;
		}
		else {
			return _firstName;
		}
	}

	public void setFirstName(String firstName) {
		_firstName = firstName;
	}

	public String getLastName() {
		if (_lastName == null) {
			return StringPool.BLANK;
		}
		else {
			return _lastName;
		}
	}

	public void setLastName(String lastName) {
		_lastName = lastName;
	}

	public int getMale() {
		return _male;
	}

	public void setMale(int male) {
		_male = male;
	}

	public String getEmail() {
		if (_email == null) {
			return StringPool.BLANK;
		}
		else {
			return _email;
		}
	}

	public void setEmail(String email) {
		_email = email;
	}

	public String getJobtitle() {
		if (_jobtitle == null) {
			return StringPool.BLANK;
		}
		else {
			return _jobtitle;
		}
	}

	public void setJobtitle(String jobtitle) {
		_jobtitle = jobtitle;
	}

	public String getOrganization() {
		if (_organization == null) {
			return StringPool.BLANK;
		}
		else {
			return _organization;
		}
	}

	public void setOrganization(String organization) {
		_organization = organization;
	}

	public String getDepartment() {
		if (_department == null) {
			return StringPool.BLANK;
		}
		else {
			return _department;
		}
	}

	public void setDepartment(String department) {
		_department = department;
	}

	public Users toEscapedModel() {
		if (isEscapedModel()) {
			return (Users)this;
		}
		else {
			return (Users)Proxy.newProxyInstance(Users.class.getClassLoader(),
				new Class[] { Users.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
					Users.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		UsersImpl clone = new UsersImpl();

		clone.setId(getId());
		clone.setCompanyId(getCompanyId());
		clone.setScreenName(getScreenName());
		clone.setFirstName(getFirstName());
		clone.setLastName(getLastName());
		clone.setMale(getMale());
		clone.setEmail(getEmail());
		clone.setJobtitle(getJobtitle());
		clone.setOrganization(getOrganization());
		clone.setDepartment(getDepartment());

		return clone;
	}

	public int compareTo(Users users) {
		int value = 0;

		value = getScreenName().compareTo(users.getScreenName());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Users users = null;

		try {
			users = (Users)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = users.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(21);

		sb.append("{id=");
		sb.append(getId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", screenName=");
		sb.append(getScreenName());
		sb.append(", firstName=");
		sb.append(getFirstName());
		sb.append(", lastName=");
		sb.append(getLastName());
		sb.append(", male=");
		sb.append(getMale());
		sb.append(", email=");
		sb.append(getEmail());
		sb.append(", jobtitle=");
		sb.append(getJobtitle());
		sb.append(", organization=");
		sb.append(getOrganization());
		sb.append(", department=");
		sb.append(getDepartment());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(34);

		sb.append("<model><model-name>");
		sb.append("com.hwccl.importor.users.model.Users");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>id</column-name><column-value><![CDATA[");
		sb.append(getId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>screenName</column-name><column-value><![CDATA[");
		sb.append(getScreenName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>firstName</column-name><column-value><![CDATA[");
		sb.append(getFirstName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lastName</column-name><column-value><![CDATA[");
		sb.append(getLastName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>male</column-name><column-value><![CDATA[");
		sb.append(getMale());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>email</column-name><column-value><![CDATA[");
		sb.append(getEmail());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>jobtitle</column-name><column-value><![CDATA[");
		sb.append(getJobtitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organization</column-name><column-value><![CDATA[");
		sb.append(getOrganization());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>department</column-name><column-value><![CDATA[");
		sb.append(getDepartment());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _id;
	private long _companyId;
	private String _screenName;
	private String _firstName;
	private String _lastName;
	private int _male;
	private String _email;
	private String _jobtitle;
	private String _organization;
	private String _department;
	private transient ExpandoBridge _expandoBridge;
}